package com.chaochis.controller;

import com.chaochis.exceptions.PasswordParserException;
import com.chaochis.params.user.LoginParam;
import com.chaochis.service.IUserService;
import com.chaochis.utils.SecurityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 刘超
 * @version 1.0
 * 该类主要用于登录模块
 * Created in 2024/11/30 21:11
 */
@RestController
@RequestMapping("/admin/login")
public class LoginController {

    @Autowired
    private IUserService userService;

    /**
     * 处理密码登录请求
     *
     * @param loginParam 登录参数，包含用户名和密码
     */
    @RequestMapping("/password-login")
    public void login(LoginParam loginParam) throws PasswordParserException {
        var password = SecurityUtil.decryptPassword(loginParam.getAccountPassword());
    }

//    @RequestMapping("/get-public-key")
//    public ApiResult<String> getPublicKey() {
//        return ApiResult.success(SecurityUtil.getPublicKey());
//    }


    @RequestMapping("")
    public void Register(LoginParam loginParam) {
    }


}
